package br.com.faculdade.infrastructure.dao;

import br.com.faculdade.infrastructure.entity.Lancamento;
import java.io.Serializable;
import org.hibernate.Session;
import org.jboss.seam.annotations.AutoCreate;
import org.jboss.seam.annotations.In;
import org.jboss.seam.annotations.Logger;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.annotations.TransactionPropagationType;
import org.jboss.seam.annotations.Transactional;
import org.jboss.seam.log.Log;

/**
 * Classe de acesso aos dados de Lancamento
 * @author Kirmaier
 */
@AutoCreate
@Name("lancamentoDAO")
@Transactional(TransactionPropagationType.SUPPORTS)
public class LancamentoDAO implements Serializable {

    @In
    private Session reservaDB;
    @Logger
    private Log log;

    public void pagamento(Lancamento lancamento) {
        log.info("Persisti o pagamento");

        reservaDB.save(lancamento);
        reservaDB.flush();
    }
}
